<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" type="text/css" href="../img-font/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/css.css" />
		<link rel="stylesheet" type="text/css" href="../css/weui.css" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<script src="../js/jquery.min.js"></script>
		<script src="../js/main.js"></script>
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../js/Url.js"></script>
		<title></title>
		<style type="text/css">
			ul,
			li {
				list-style: none;
			}
			
			i {
				font-style: normal;
			}
			
			.record-external {
				width: 100%;
				height: 100%;
				background: #ebebeb;
			}
			
			.record {
				width: 100%;
				height: 40px;
				text-align: center;
				background: #666;
				line-height: 40px;
				color: #fff;
			}
			
			nav {
				height: 100%;
				background: #fff;
				overflow-y: scroll;
				font-size: 14px;
				margin-top: 50px;
				padding: 0 15px;
			}
			
			.fanjian {
				height: 100%;
				display: block;
				color: #000;
				font-size: 24px;
				line-height: 30px;
				float: left;
				text-indent: 24px;
				position: absolute;
				top: 10px;
				left: 0;
			}
			
			.record_ul {
				margin-bottom: 20px;
			}
			
			.record-li {
				background: ;
				border-bottom: 1px solid #E0E0E0;
				line-height: 41px;
				margin-top: 20px;
				padding-left: 24px;
			}
			
			.record-li span {
				margin-right: 10px;
				color: #0094ff;
			}
			
			.record-li i {
				color: red;
				text-indent: 24px;
			}
			
			.record-li p {
				color: orange;
			}
			
			.bb-btn1 {
				width: 110px;
				height: 68px;
				color: #686868;
				border: 1px solid #f15353;
				border-radius: 6px;
				background: #f15353;
				font-size: 26px;
				line-height: 68px;
				text-align: center;
				-webkit-transform: scale(.5, .5);
				transform: scale(.5, .5);
				-webkit-transform-origin: top left;
				transform-origin: top left;
				color: #fff;
				float: right;
			}
			
			#iosDialog2 {
				display: none;
			}
		</style>
	</head>

	<body>
		<!--纪录列表-->
		<div class="record-external">
			<div class="topnav">
				<a href="javascript:history.go(-1)"><span class="fanjian iconfont icon-xia"></span></a>未领取奖励
			</div>
			<nav>
				<div class="record_list">
					<ul class="record_ul">

					</ul>
				</div>
			</nav>
		</div>
		<div class="js_dialog js_dialog_tp" id="iosDialog2">
			<div class="weui-mask"></div>
			<div class="weui-dialog">
				<div class="weui-dialog__bd weui_centent">弹窗内容，告知当前状态、信息和解决方法，描述文字尽量控制在三行内</div>
				<div class="weui-dialog__ft">
					<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">知道了</a>
				</div>
			</div>
		</div>
	</body>

</html>
<script type="text/javascript">
	//时间转换
	function getLocalTime(nS) {
		return new Date(parseInt(nS)).toLocaleString().substr(0, 17)

	}
	//	expendTime
	$(function() {
		var id = '';
		$.ajax({
			type: "get",
			url: baseUrl + "foot/user/getMissionByStatus",
			success: function(res) {

				console.log(res)
				for(var i = 0; i < res.data.length; i++) {
					var str = '';
					str += '<li class="record-li">'
					str += '<p>任务内容：' + res.data[i].missionContent + '</p>';
					str += '<div>';
					str += '<span>时间：' + new Date(res.data[i].createTime).toLocaleString() + '</span><br />';
					str += '<i>获得奖励：' + res.data[i].awardContent + '</i>';
					str += '<div class="bb-btn1" title="' + res.data[i].id + '">领取</div>'
					str += '</div>';
					str += '</li>';

					$('.record_ul').append(str)
				}

				$('.bb-btn1').on('click', function() {
					id = $(this).attr('title');
					$.ajax({
						type: "get",
						url: baseUrl + "foot/user/getUserAward",
						data: {
							'id': id
						},
						success: function(res) {
							console.log(res)
							if(res.data.record.awardId == 1) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId == 2) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId == 3) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId == 4) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId == 5) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId == 6) {
								Prompt('领取成功！')
							} else if(res.data.record.awardId > 6) {
								window.location.href = '' + BaseUrl + '/text/index.html?awardId=' + res.data.record.awardId + '';
							}
						}
					});
				})
			}
		});
	})

	function Prompt(word) {
		$('.js_dialog_tp').show();
		$('.weui_centent').html(word);

	}
	$('.weui-dialog__btn_primary').on('click', function() {
		$('#iosDialog2').hide();
		window.location.reload();
	})
</script>